package com.changanw.order.controller;

import com.changanw.common.RespBean;
import com.changanw.common.feign.OrderServiceApi;
import com.changanw.order.service.OrderService;
import io.seata.rm.tcc.api.BusinessActionContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 */
@RestController
public class OrderController implements OrderServiceApi {

    @Autowired
    OrderService orderService;

    @Override
    public boolean prepare(BusinessActionContext context, String userId, String productId, Integer count) {
        return orderService.prepare(context,userId,productId,count);
    }

    @Override
    public boolean commit(BusinessActionContext context) {
        return orderService.commit(context);
    }

    @Override
    public boolean rollback(BusinessActionContext context) {
        return orderService.rollback(context);
    }
}
